Skip to content

simplify code#13

Merged
EvilLord666 merged 2 commits intoWissance:masterfrom
rprtr258:dev
Aug 1, 2023
Merged

simplify code#13
EvilLord666 merged 2 commits intoWissance:masterfrom
rprtr258:dev

Conversation

@rprtr258
Copy link
Copy Markdown
Contributor

@rprtr258 rprtr258 commented Jul 18, 2023

  • change interface{} to any
  • move templateLen, formattedStr after early exit, as they are not needed before it
  • reduce in loop indent with if ... { ... continue } else { ... } to if ... { ... continue} ...
  • simplify switch-case in getItemAsStr func
  • prettify tests code, organize into stringFormatter_test package in order not to export some test symbols, organize tests into table tests
  • change MapToString to accept just map, instead of pointer to it, and format instead of predefined strings, preallocate buffer which reduced memory consumption a bit
  • updated readme with according changes and some fixes

dev: rename

dev: simplify tests

dev: prettify test
@rprtr258 rprtr258 changed the title Draft: simplify code simplify code Jul 18, 2023
@rprtr258 rprtr258 marked this pull request as draft July 18, 2023 19:33
@rprtr258 rprtr258 marked this pull request as ready for review July 18, 2023 19:33
@EvilLord666 EvilLord666 self-assigned this Jul 31, 2023
@EvilLord666 EvilLord666 added this to the StringFormatter v1.1.1 milestone Jul 31, 2023
@EvilLord666
Copy link
Copy Markdown
Member

All tests are working, benchmark still shows slight performance advance in comparison to fmt, moving to code review

Copy link
Copy Markdown
Member

@EvilLord666 EvilLord666 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor changes are required: Example should be renamed to more clear type i.e. meteoData and should be made visible only for _test package

Comment thread formatter_test.go Outdated
@EvilLord666 EvilLord666 merged commit 5f32565 into Wissance:master Aug 1, 2023
@EvilLord666
Copy link
Copy Markdown
Member

These changes will be included in sf of version 1.1.1, thanks, @rprtr258

@EvilLord666 EvilLord666 moved this from Review to Done in StringFormatter Jun 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants